package com.contacts.taopiaopiao;

import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

public class MainActivity extends BaseActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toast.makeText(that,"淘票票启动了",Toast.LENGTH_SHORT).show();
        findViewById(R.id.img).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(that,"淘票票的点击事件",Toast.LENGTH_SHORT).show();
                startActivity(new Intent(that,SceondActivity.class));
                startService(new Intent(that,OneService.class));

                IntentFilter intentFilter = new IntentFilter();
                intentFilter.addAction("com.contacts.taopiaopiao.MainActivity");
                registerReceiver(new MyReceiver(),intentFilter);
            }
        });

        findViewById(R.id.send_broad).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setAction("com.contacts.taopiaopiao.MainActivity");
                sendBroadcast(intent);
            }
        });
    }

    @Override
    public void onStart() {
        super.onStart();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();

    }
}
